projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
22b91e9
)
Don't run backward past beginning of all-whitespace string.
author
robertl
<robertl>
Tue, 23 Sep 2003 15:56:08 +0000
(15:56 +0000)
committer
robertl
<robertl>
Tue, 23 Sep 2003 15:56:08 +0000
(15:56 +0000)
util.c
patch
|
blob
|
history
diff --git
a/util.c
b/util.c
index fb5f624e1b4e3e1ecf95fc22e76cd25bcfd4ff3f..0bd965b8162128466beb8b32898722c939d7abab 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-237,6
+237,8
@@
pstrdup(char *src)
void
rtrim(char *s)
{
+ char *t = s;
+
if (!s || !*s) {
return;
}
@@
-246,7
+248,7
@@
rtrim(char *s)
}
s--;
- while (isspace (*s)) {
+ while (
(s >= t) &&
isspace (*s)) {
*s = 0;
s--;
}